package com.changgou.task;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Project: com.changgou.task
 * @Author: ShaoDi Wang
 * @Date: Created in 2019-08-11 17:20
 * @Description:
 * @Version: 1.0
 */
@Component
public class OrderTask {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Scheduled(cron = "0 0 0 * * ?")
    public void auto(){
        rabbitTemplate.convertAndSend( "exchange.order_task","","-" );
    }
}
